package com.acsior.hibernate.vo;

// default package

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.ddfn.impl.hibernate.vo.NomElementVO;

/**
 * SecGroup entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sec_groups", uniqueConstraints = @UniqueConstraint(columnNames = "system_name"))
@GeneratorKey(tableName = "sec_groups")
public class SecGroupVO extends NomElementVO {

	private static final long serialVersionUID = -4574189961023459581L;

	@Column(name = "creation_date", nullable = false, length = 23)
	private Date creationDate;

	@ManyToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY, mappedBy = "secGroups")
	private List<EmployeeVO> employees;

	@Column(name = "is_active", nullable = false)
	private boolean isActive;

	@Column(name = "notification")
	private int notification;

	@Column(name = "period")
	private int period;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "secGroup")
	private List<SecAllowedGroupResourceVO> secAllowedGroupResources;

	// Constructors

	/** default constructor */
	public SecGroupVO() {
		this.secAllowedGroupResources = new ArrayList<SecAllowedGroupResourceVO>();
		this.employees = new ArrayList<EmployeeVO>();
	}

	/**
	 * @return стойността на creationDate
	 */
	public Date getCreationDate() {
		return this.creationDate;
	}

	/**
	 * @return стойността на employees
	 */
	public List<EmployeeVO> getEmployees() {
		return this.employees;
	}

	/** @return the notification */
	public int getNotification() {
		return this.notification;
	}

	/** @return the period */
	public int getPeriod() {
		return this.period;
	}

	/**
	 * @return стойността на secAllowedGroupResources
	 */
	public List<SecAllowedGroupResourceVO> getSecAllowedGroupResources() {
		return this.secAllowedGroupResources;
	}

	/**
	 * @return стойността на isActive
	 */
	public boolean isActive() {
		return this.isActive;
	}

	/**
	 * @param isActive
	 *            се залага в isActive
	 */
	public void setActive(boolean isActive) {
		this.isActive = isActive;
	}

	/**
	 * @param creationDate
	 *            се залага в creationDate
	 */
	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	/**
	 * @param employees
	 *            се залага в employees
	 */
	public void setEmployees(List<EmployeeVO> employees) {
		this.employees = employees;
	}

	/**
	 * @param notification
	 *            the notification to set
	 */
	public void setNotification(int notification) {
		this.notification = notification;
	}

	/**
	 * @param period
	 *            the period to set
	 */
	public void setPeriod(int period) {
		this.period = period;
	}

	/**
	 * @param secAllowedGroupResources
	 *            се залага в secAllowedGroupResources
	 */
	public void setSecAllowedGroupResources(List<SecAllowedGroupResourceVO> secAllowedGroupResources) {
		this.secAllowedGroupResources = secAllowedGroupResources;
	}
}